<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>多张图片垂直居中</title>
        <style type="text/css">
            .imgWrap li {
                background: #ffa url(images/gridBg.gif) repeat center;
                width: 219px;
                height: 219px;
                float: left;
                border: solid 1px #666;
                margin: 10px 10px 0 0;
                list-style: none;
                text-align: center;
            }
            .table {
                width: 100%;
                height: 100%;
                display: table;
                position: relative;
            }       

            .tableCell {                
                display: table-cell;
                vertical-align: middle;
                text-align: center;         
                padding: 10px;
                *position: absolute;
                *top: 50%;
                *left: 50%;
            }
            .imgWrap a {
                display: block;
                *position:relative;
                *top: -50%;
                *left: -50%;
            }
        </style>
    </head>
    <body>
        <ul class="imgWrap clearfix">
            <li>
                <div class="table">
                    <div class="tableCell">
                        <a href="#" class="imgBox"><img src="images/img1.jpg" alt="" /></a>
                    </div>
                </div>  
            </li>
            <li>
                <div class="table">
                    <div class="tableCell">
                        <a href="#" class="imgBox"><img src="images/img2.jpg" alt="" /></a>
                    </div>
                </div>  
            </li>
            <li>
                <div class="table">
                    <div class="tableCell">
                        <a href="#" class="imgBox"><img src="images/img3.jpg" alt="" /></a>
                    </div>
                </div>  
            </li>
            <li>
                <div class="table">
                    <div class="tableCell">
                        <a href="#" class="imgBox"><img src="images/img4.jpg" alt="" /></a>
                    </div>
                </div>  
            </li>
        </ul>
    </body>
</html>